package com.fly.studio.home.app.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fly.studio.home.app.request.HomePageRequest;
import com.fly.studio.home.app.response.Response;
import com.fly.studio.home.app.response.vo.HomePageVO;
import com.fly.studio.home.app.service.HomePageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * Home Controller
 *
 * @author fuliying3
 * @date 2022/08/23 09:13:00
 */
@RestController
@Api(value = "HomePage-Controller")
@RequestMapping(value = "home-page")
public class HomePageController {

    @Resource
    private HomePageService homePageService;

    @ApiOperation(value = "home-page")
    @PostMapping
    public Response<HomePageVO> homePage(@RequestBody @Valid HomePageRequest request) {
        return Response.success(homePageService.homePage(request));
    }

    @ApiOperation(value = "home-page-data")
    @PostMapping(path = "mock")
    public JSONObject homePageMock() {
        System.out.println("1233294923942394");
        String responseData = "{\n" +
                "    \"code\": 200,\n" +
                "    \"msg\": \"请求成功\",\n" +
                "    \"result\": {\n" +
                "        \"act_info\": [\n" +
                "            {\n" +
                "                \"icon_url\": \"/operation/img/1478169868/1478761370286.png\",\n" +
                "                \"name\": \"活动区域\",\n" +
                "                \"url\": \"/oper/1478169868app.html\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"icon_url\": \"/operation/img/1478763176/1478762941492.png\",\n" +
                "                \"name\": \"活动区域\",\n" +
                "                \"url\": \"/oper/1478763176app.html\"\n" +
                "            }\n" +
                "        ],\n" +
                "        \"banner_info\": [\n" +
                "            {\n" +
                "                \"image\": \"/1478770583834.png\",\n" +
                "                \"option\": 3,\n" +
                "                \"type\": 0,\n" +
                "                \"value\": {\n" +
                "                    \"url\": \"/act20161111?cyc_app=1\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"image\": \"/1478770583835.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 0,\n" +
                "                \"value\": {\n" +
                "                    \"url\": \"/act20161111?cyc_app=1\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"image\": \"/1478770583836.png\",\n" +
                "                \"option\": 1,\n" +
                "                \"type\": 0,\n" +
                "                \"value\": {\n" +
                "                    \"url\": \"/act20161111?cyc_app=1\"\n" +
                "                }\n" +
                "            }\n" +
                "        ],\n" +
                "        \"channel_info\": [\n" +
                "            {\n" +
                "                \"channel_name\": \"服饰\",\n" +
                "                \"image\": \"/app/img/menu-cyc.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"8\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"游戏\",\n" +
                "                \"image\": \"/app/img/menu-game.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"4\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"动漫\",\n" +
                "                \"image\": \"/app/img/menu-carttoon.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"3\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"装扮\",\n" +
                "                \"image\": \"/app/img/menu-cosplay.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"5\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"古风\",\n" +
                "                \"image\": \"/app/img/menu-oldage.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"6\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"漫展票务\",\n" +
                "                \"image\": \"/app/img/menu-collect.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"9\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"文具\",\n" +
                "                \"image\": \"/app/img/menu-stationery.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"11\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"零食\",\n" +
                "                \"image\": \"/app/img/menu-snack.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"10\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"首饰\",\n" +
                "                \"image\": \"/app/img/menu-jewelry.png\",\n" +
                "                \"option\": 2,\n" +
                "                \"type\": 1,\n" +
                "                \"value\": {\n" +
                "                    \"channel_id\": \"12\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"channel_name\": \"更多\",\n" +
                "                \"image\": \"/app/img/menu-more.png\",\n" +
                "                \"option\": 6,\n" +
                "                \"type\": 1,\n" +
                "                 \"value\": {\n" +
                "                    \"channel_id\": \"13\"\n" +
                "                }\n" +
                "            }\n" +
                "        ],\n" +
                "        \"hot_info\": [\n" +
                "            {\n" +
                "                \"cover_price\": \"3290.00\",\n" +
                "                \"figure\": \"/1477984921265.jpg\",\n" +
                "\t\"details\": \"/details/添可智能洗地机.jpg\",\n" +
                "                \"name\": \"添可(TINECO)无线智能洗地机芙万2.0 slim家用扫地机拖地一体清洁手持吸尘器\",\n" +
                "\t\"product_id\": \"9356\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"8899.00\",\n" +
                "                \"figure\": \"/1477984931882.jpg\",\n" +
                "                \"name\": \"Apple 苹果 iPhone 13 Pro（A2639）全网通5G手机 128G 远峰蓝色（享一年延保） 套装一：搭配 90天品胜碎屏保障\",\n" +
                "                \"details\": \"/details/苹果手机.jpg\",\n" +
                "\t\"product_id\": \"10391\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"4999.00\",\n" +
                "                \"figure\": \"/1452161899947.jpg\",\n" +
                "                \"name\": \"小米 MIX4 骁龙888+ 一体化陶瓷机身 全面屏 一亿像素三摄 哈曼卡顿双扬声器 12GB+256GB 陶瓷黑 5G旗舰手机\",\n" +
                "\t\"details\": \"/details/小米mix4.jpg\",\n" +
                "                \"product_id\": \"3831\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"14999.00\",\n" +
                "                \"figure\": \"/1447232577216.jpg\",\n" +
                "                \"name\": \"Apple MacBook Pro 14英寸 M1 Pro芯片(8核中央处理器 14核图形处理器) 16G 512G 深空灰 笔记本电脑 轻薄本 MKGP3CH/A\",\n" +
                "\t\"details\": \"/details/苹果笔记本.jpg\",\n" +
                "                \"product_id\": \"2691\"\n" +
                "\t\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"10.90\",\n" +
                "                \"figure\": \"/1474370572805.jpg\",\n" +
                "                \"name\": \"其妙芋泥流心酥芋头酥雪媚娘蛋黄酥网红吃货零食休闲食品全国小吃 芋泥流心酥6枚\",\n" +
                "\t\"details\": \"/details/其妙芋泥.jpg\",\n" +
                "                \"product_id\": \"9414\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"199.10\",\n" +
                "                \"figure\": \"/1465268743242.jpg\",\n" +
                "                \"name\": \"【氢速科技】乔丹官方旗舰【咻-轻速】运动鞋男2021冬季新款网面透气减震男士轻便跑步鞋乔丹男鞋 乔丹白/冰川蓝 42\",\n" +
                "                \"details\": \"/details/跑步鞋乔丹男鞋 乔.jpg\",\n" +
                "\t\"product_id\": \"6869\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"48.80\",\n" +
                "                \"figure\": \"/1477360350123.jpg\",\n" +
                "                \"name\": \"联想u盘32g移动金属手机电脑两用大容量高速3.0优盘type-c双接口双头商务办公U盘车载苹果华为 32G MU254 U盘\",\n" +
                "                \"details\": \"/details/联想u盘.jpg\",\n" +
                "\t\"product_id\": \"10136\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"3099.00\",\n" +
                "                \"figure\": \"/1467702094592.jpg\",\n" +
                "                \"name\": \"神舟(HASEE)炫龙 A4 E1 14英寸轻薄笔记本电脑(R5 3450U 8G 256G SSD IPS)\",\n" +
                "                \"details\": \"/details/神舟笔记本.jpg\",\n" +
                "\t\"product_id\": \"7752\"\n" +
                "            }\n" +
                "        ],\n" +
                "        \"recommend_info\": [\n" +
                "            {\n" +
                "                \"cover_price\": \"3998.00\",\n" +
                "                \"figure\": \"/supplier/1.jpg\",\n" +
                "                \"name\": \"美的（ Midea）初见白泽1200G升级版 智能家电 家用除菌厨下式 长效RO反渗透净水器 MRO806-3000\",\n" +
                "                \"details\": \"/details/美的反渗透净水器.jpg\",\n" +
                "\t\"product_id\": \"10659\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"4599.00\",\n" +
                "                \"figure\": \"/supplier/2.jpg\",\n" +
                "                \"name\": \"联想(Lenovo)天逸510Pro AMD个人商务台式机电脑整机(锐龙5-5600G 16G 1TB HDD+256G SSD win11)23英寸\",\n" +
                "                \"details\": \"/details/联想电脑.jpg\",\n" +
                "\t\"product_id\": \"10658\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"8788.00\",\n" +
                "                \"figure\": \"/supplier/3.jpg\",\n" +
                "                \"name\": \"微软Surface Pro 8 李现同款 8G+256G 11代酷睿i5 二合一平板 亮铂金 13英寸超窄边框触屏 轻薄本笔记本电脑\",\n" +
                "                \"details\": \"/details/微软surface平板.jpg\",\n" +
                "\t\"product_id\": \"10657\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"139.00\",\n" +
                "                \"figure\": \"/supplier/4.jpg\",\n" +
                "                \"name\": \"FTFU 真无线TWS蓝牙耳机半入耳式双耳通话降噪游戏吃鸡迷你运动跑步音乐苹果华为小米手机电脑通用 黑色【智能降噪/无延迟】\",\n" +
                "                \"details\": \"/details/FTFU蓝牙耳机.jpg\",\n" +
                "\t\"product_id\": \"10656\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"3140.00\",\n" +
                "                \"figure\": \"/supplier/5.jpg\",\n" +
                "                \"name\": \"【11.11预售】雪花秀滋盈生人参护肤品礼盒套装(人参水125ml+人参乳液125ml+精华30ml+面霜30ml)\",\n" +
                "                \"details\": \"/details/雪花秀.jpg\",\n" +
                "\t\"product_id\": \"10655\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"cover_price\": \"175.00\",\n" +
                "                \"figure\": \"/supplier/6.jpg\",\n" +
                "                \"name\": \"前行者（EWEADN）912蒸汽朋克复古机械键盘 游戏办公键盘 有线键盘 电脑键盘外设 青轴 全键无冲\",\n" +
                "                \"details\": \"/details/前行者机械键盘.jpg\",\n" +
                "\t\"product_id\": \"10654\"\n" +
                "            }\n" +
                "        ],\n" +
                "        \"seckill_info\": {\n" +
                "            \"end_time\": \"1479052800\",\n" +
                "            \"list\": [\n" +
                "                {\n" +
                "                    \"cover_price\": \"7.80\",\n" +
                "                    \"figure\": \"/seckill/1.jpg\",\n" +
                "                    \"name\": \"其妙白桃味乳酸菌面包整箱 小口袋面包 早餐代餐休闲食品 健康小零食 办公室下午茶 白桃味小口袋250g\",\n" +
                "                    \"origin_price\": \"9.00\",\n" +
                "                    \"details\": \"/details/其妙白桃味乳酸菌面包.jpg\",\n" +
                "\t    \"product_id\": \"7100\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"cover_price\": \"299.00\",\n" +
                "                    \"figure\": \"/seckill/2.jpg\",\n" +
                "                    \"name\": \"漫步者（EDIFIER）LolliPods Pro 真无线降噪蓝牙耳机 主动降噪 蓝牙耳机 通用苹果安卓手机 雪映白\",\n" +
                "                    \"origin_price\": \"350.00\",\n" +
                "                    \"details\": \"/details/漫步者蓝牙耳机.jpg\",\n" +
                "\t    \"product_id\": \"7101\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"cover_price\": \"1569.00\",\n" +
                "                    \"figure\": \"/seckill/3.jpg\",\n" +
                "                    \"name\": \"小米 红米Redmi Note11 pro 新品5G手机 迷雾森林 6GB+128GB 官方标配\",\n" +
                "                    \"origin_price\": \"1799.00\",\n" +
                "                    \"details\": \"/details/redminote11pro.jpg\",\n" +
                "\t    \"product_id\": \"7102\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"cover_price\": \"9.80\",\n" +
                "                    \"figure\": \"/seckill/4.jpg\",\n" +
                "                    \"name\": \"ON 智能插座/插线板/插排/接线板/排插 一转三转换器\",\n" +
                "                    \"origin_price\": \"12.99\",\n" +
                "                    \"details\": \"/details/插座.jpg\",\n" +
                "\t    \"product_id\": \"9593\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"cover_price\": \"41.80\",\n" +
                "                    \"figure\": \"/seckill/5.jpg\",\n" +
                "                    \"name\": \"景田 百岁山 饮用天然矿泉水 348ml*24瓶整箱装\",\n" +
                "                    \"origin_price\": \"55.90\",\n" +
                "                    \"details\": \"/details/百岁山.jpg\",\n" +
                "\t    \"product_id\": \"10536\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"cover_price\": \"1669.00\",\n" +
                "                    \"figure\": \"/seckill/6.jpg\",\n" +
                "                    \"name\": \"容声(Ronshen)219升小型两门冰箱家用双门风冷无霜节能低噪大冷冻空间银色面板BCD-219WD12D\",\n" +
                "                    \"origin_price\": \"1799.00\",\n" +
                "                    \"details\": \"/details/冰箱.jpg\",\n" +
                "\t    \"product_id\": \"555\"\n" +
                "                }\n" +
                "            ],\n" +
                "            \"start_time\": \"1478772000\"\n" +
                "        }\n" +
                "    }\n" +
                "}";
        return JSON.parseObject(responseData);
    }
}
